package com.oracle.controller;

import com.oracle.common.R;
import com.oracle.pojo.Gly;
import com.oracle.service.GlyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private GlyService glyService;

    @PostMapping("/login")
    public R login(@RequestBody Gly gly)
    {
        Gly gly1 = glyService.login(gly.getGlyUsername(),gly.getGlyPassword());
        if(!ObjectUtils.isEmpty(gly1))
        {
            return R.success("登录成功");
        }else{
            return R.filed("登录失败");
        }
    }


}
